//
//  NotiDetailsViewController.m
//  Findif
//
//  Created by Mac on 2018/12/10.
//  Copyright © 2018年 Cicel Chen. All rights reserved.
//

#import "NotiDetailsViewController.h"

@interface NotiDetailsViewController ()

@property (nonatomic, weak)UILabel * timeLabel;
@property (nonatomic, weak)UILabel * contentLabel;

@end

@implementation NotiDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title = @"消息详情";
    self.view.backgroundColor = ZRWhiteColor;
    
    [self setupUI];
    [self loadData];
}

- (void)loadData{
    
    [[ZRNetworkTool sharedTool] updateUserNoticeWithNoti_id:self.ID ResultWithBlock:^(BOOL success, id responseData) {
        
//        NSLog(@"res===%@",responseData);
    }];
    
}

- (void)setupUI{
    
    UILabel * contentLabel = [UILabel new];
    
    contentLabel.textColor = ZRBlackColor;
    contentLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    contentLabel.numberOfLines = 0;
    contentLabel.text = self.content;
    
    self.contentLabel = contentLabel;
    
    [self.view addSubview:self.contentLabel];
    
    
    UILabel * timeLabel = [UILabel new];
    
    timeLabel.textColor = [UIColor lightGrayColor];
    timeLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    timeLabel.textAlignment = NSTextAlignmentRight;
    timeLabel.text = self.time;
    
    self.timeLabel = timeLabel;
    
    [self.view addSubview:self.timeLabel];
}

- (void)viewDidLayoutSubviews{
    
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.view).offset(15 * SCREENH6);
        make.trailing.mas_equalTo(self.view).offset(-15 * SCREENH6);
        make.top.mas_equalTo(self.view).offset(10 * SCREENH6 + kNavHeight + kStatusBarHeight);
    }];
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.view).offset(-10 * SCREENH6);
        make.top.mas_equalTo(self.contentLabel.mas_bottom).offset(10 * SCREENH6);
    }];
}

@end
